package com.ewuyong.concurrence.example.immutable;

import com.ewuyong.concurrence.annotations.ThreadSafe;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;

import java.util.Collections;
import java.util.Map;

@Slf4j
@ThreadSafe
public class ImmutableExample3 {

   public final static ImmutableSet<Integer> set = ImmutableSet.of(1, 2, 3);

   public final static ImmutableList<Integer> list = ImmutableList.copyOf(set);

   public final static ImmutableMap<Integer, Integer> map = ImmutableMap.<Integer, Integer>builder().put(1, 2).build();

   public static void main(String[] args) {
        set.add(5);
   }
}
